<?php
require_once("conn.php");
$q = strtolower($_GET["q"]);
if (!$q) return;

$sql = "SELECT Barcode,Product_Name FROM stock WHERE (Barcode like '%".$q."%') OR Product_Name like '%".$q."%'";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
	echo $row["Barcode"]."  |  ".$row["Product_Name"]."\n";
}

?>